import request from '@/router/axios'
import store from '@/store'
import {getMappingStatusArray} from "../../../../subwayRat/commonCheck";


export function update_xw_SwStApplyNetworkCheckPassengerAffairs(param) {
  return request({
    url: '/check/xw/update_xw_SwStApplyNetworkCheckPassengerAffairs',
    method: 'post',
    params: param,
    data:param
  })
}

export function xw_cksw_form_Option(th){
  return {
  submitBtn:false,
  emptyBtn:false,
  group:[
    {
      icon:'',
      label: '',
      // collapse:false,
      prop: 'group1',
      column: [{
        label: '部门',
        width: 70,
        prop: 'deptName',
        search: false,
        hide: false,
        disabled : true,
        type:'input',
      },{
        label: '线路名称',
        prop: 'lineCode',
        type: 'input',
        width:250,
        disabled : true,
      },{
        label: '站点名称',
        prop: 'stationCode',
        type: 'input',
        width:250,
        disabled : true,
      },{
        label: '发单时间',
        prop: 'transactionTime',
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd',
        width: 75,
        type: 'date',
        hide: false,
        disabled: th.showType==3,
        rules: [
          {
            required: true,
            message: "请选择发单时间"
          }
        ]
      },{
        label: '要求回复时间',
        prop: 'hopeReturnTime',
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd',
        width: 120,
        type: 'date',
        hide: false,
        disabled: th.showType==3,
        rules: [
          {
            required: true,
            message: "请选择要求回复时间"
          }
        ]
      },{
        hide: false,
        label: '事务类型',
        prop: 'transactionType',
        disabled : th.showType==3,
        type: 'select',
        dicData:getMappingStatusArray('TRANSACTION_TYPE'),
        rules: [
          {
            required: true,
            message: "请选择事务类型"
          }
        ]
      },{
        display: true,
        hide: false,
        label: '车站上传附件',
        prop: 'stationFile',
        type: "upload",
        component: "zd-upload",
        dataType: "string",
        width: 120,
        disabled: th.showType==3,
        search: false
      }, {
        hide: false,
        label: '线网上传附件',
        prop: 'lineFile',
        type: "upload",
        component: "zd-upload",
        dataType: "string",
        width: 120,
        disabled: th.showType==3,
        search: false,
        display: th.showType==3
      }, {
        hide: false,
        width: 70,
        label: '反馈人',
        prop: 'returnCreatorName',
        // formslot: true,
        // slot: true,
        display:th.showType==3,
        disabled: th.showType==3,
      }, {
        hide: false,
        label: '反馈人工号',
        prop: 'returnCreatorCode',
        width: 100,
        formslot: true,
        slot: true,
        display:th.showType==3,
        disabled: th.showType==3,
        search: false
      },{
        hide: false,
        label: '反馈时间',
        prop: 'returnTime',
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd',
        type:'date',
        display:th.showType==3,
        disabled: th.showType==3,
        search: false
      },{
        label: '申请原因',
        width: 100,
        prop: 'applyCase',
        disabled : th.showType==3,
        type:'textarea',
        rules: [
          {
            required: true,
            message: "请输入申请原因"
          }
        ]
      },{
        label: '车站排查经过及结果',
        width: 180,
        prop: 'applyDetail',
        search: false,
        hide: false,
        disabled: th.showType==3,
        type:'textarea',
        rules: [
          {
            required: true,
            message: "请输入车站排查经过及结果"
          }
        ]
      },{
        label: '反馈结果',
        width: 100,
        prop: 'returnData',
        search: false,
        hide: true,
        display:th.showType==3,
        disabled: th.showType==3,
        type:'textarea'
      }]
    },
  ]
}
};


export function xw_cksw_optionTwo(th) {
  return {
  border: true,
  index: false,
  menu: false,
  header:false,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  viewBtn: false,
  editBtn: false,
  delBtn: false,
  emptyBtn:false,
  align: 'center',
  selection: false,
  reserveSelection:false,
  addBtn: false,
  column: [{
    label: '设备类型',
    prop: 'deviceType',
    formatter:function(row, value , label, column){
	  if(value!="" && value!='undefined' && value!=undefined){		 
	    return value == 1?'BOM':'TVM';
	  }
	  return "";
    },
    type: 'select',
    dicData: [{
      label: '',
      value: ''
    },{
      label: 'TVM',
      value: '0'
    }, {
      label: 'BOM',
      value: '1'
    }],
    search: false,
    width: 150,
    cell:true,
    rules: [
      {
        required: false,
        message: "请选择设备类型"
      }
    ]
  }, {
    label: '设备编号',
    prop: 'deviceNo',
    search: false,
    width: 150,
    cell:true,
    rules: [
      {
        required: false,
        message: "请填写设备编号"
      }
    ]
  }, {
    label: '卡号',
    prop: 'cardNumber',
    search: false,
    width: 150,
    cell:true,
    rules: [
      {
        required: false,
        message: "请填写卡号"
      }
    ]
  }, {
    label: '票种',
    prop: 'ticketType',
    type: 'select',
    formatter:function(row, value , label, column){
      if(value!="" && value!='undefined' && value!=undefined){
	     return value == 1?'其他票种':'长安通';
	  }
	  return "";
	  
    },
    dicData: [{
      label: '',
      value: ''
    },{
      label: '长安通',
      value: '0'
    }, {
      label: '其他票种',
      value: '1'
    }],
    search: false,
    width: 150,
    cell:true,
    rules: [
      {
        required: false,
        message: "请选择票种"
      }
    ]
  }, {
    label: '其他票种',
    prop: 'otherTicketName',
    slot:true,
    width: 150,
    // cell:true,
  }, {
    width: 150,
    label: '开始时间',
    prop: 'beginTime',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    type:'date',
    search: false,
    cell:true,
    rules: [
      {
        required: false,
        message: "请选择开始时间"
      }
    ]
  }, {
    width: 150,
    label: '结束时间',
    prop: 'endTime',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    type:'date',
    search: false,
    cell:true,
    rules: [
      {
        required: false,
        message: "请选择结束时间"
      }
    ]
  }]}
};
